package com.gxc.feign;

import com.gxc.dto.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author GongXincheng
 * @since 2019-08-20 18:12
 */
@FeignClient(value = "${gxc.project.dept-provider}", fallbackFactory = DeptFeignFallbackFactory.class)
public interface DeptFeign {

    @GetMapping("/test")
    String hello();

    @GetMapping("/dept/{id}")
    Dept findById(@PathVariable Long id);

    @PostMapping("/dept")
    Boolean add(@RequestBody Dept dept);

    @GetMapping("/dept/list")
    List<Dept> list();

    @GetMapping("/discovery")
    Object discovery();

}
